<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\CmsType;
use common\models\CmsContent;
use common\models\BaseSite;

/* @var $this yii\web\View */
/* @var $model common\models\CmsContent */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Cms Contents', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="cms-content-view">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php if(isset($msg)){ ?><p style="color: #f00;"><?php echo $msg; ?></p><?php } ?>
    <p>
        <?= Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
        <?= Html::a('列表', ['index'], ['class' => 'btn btn-primary']) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            //'type_id',
             [
				'attribute' => 'type_id',
				'value' =>(new CmsContent())->getTypeName($model->type_id),
             ],
             [
				'attribute' => 'site_id',
				'value' =>BaseSite::GetSites($model->site_id),
             ],
            'content:ntext',
            'create_time:datetime',
            'status',
        ],
    ]) ?>

</div>
